import java.util.Arrays;

public class Num2037 {
    public int minMovesToSeat(int[] seats, int[] students) {
        Arrays.sort(seats);
        Arrays.sort(students);
        int move = 0;
        int n = seats.length;
        for (int i = 0; i < n; i++) {
            move += Math.abs(seats[i] - students[i]);
        }
        return move;
    }
}
